import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;

public class MoYuBan
{
    private static String YuanDan = "2022-01-01";

    private static String ChunJie = "2022-02-01";

    private static String QingMing = "2022-04-05";

    public static void main(String[] args) throws ParseException
    {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        Date time = Calendar.getInstance(Locale.CHINA).getTime();
        int zhouliu = 6 - time.getDay();

        Calendar nowTime = Calendar.getInstance(Locale.CHINA);
        nowTime.setTime(time);
        nowTime.set(Calendar.HOUR_OF_DAY, 18);
        nowTime.set(Calendar.MINUTE, 0);
        long l = nowTime.getTimeInMillis() - time.getTime();
//        System.out.println("l = " + l);
        long houre = l / 1000 / 60 / 60 % 24;
        long minute = l / 1000 / 60 % 60;

        Date yuandan = sdf.parse(YuanDan);
        long yuanDan = getDay(time, yuandan);

        Date chunjie = sdf.parse(ChunJie);
        long chunJie = getDay(time, chunjie);

        Date qingming = sdf.parse(QingMing);
        long qingMing = getDay(time, qingming);

        System.out.println("【摸鱼办】提醒您：" + (time.getMonth() + 1) + "月" + time.getDate() + "日" + (time.getHours() > 12 ? "下午" : "上午") +
                "好，摸鱼人！工作再累，一定不要忘记摸鱼哦！有事没事起身去茶水间，去厕所，去廊道走走别老在工位上坐着，钱是老板的,"
                + "但命是自己的\n"
                + "距离下班还有:" + (minute > 0 ? houre + " 时 " + minute + " 分\n" : "超时"+(-minute)+"分钟啦，w d n m\n")
                + "距离周末还有:" + zhouliu + "天\n"
                + "距离元旦还有:" + yuanDan + "天\n"
                + "距离春节还有:" + chunJie + "天\n"
                + "距离清明节还有:" + qingMing + "天\n"
                + "上班是帮老板赚钱，摸鱼是赚老板的钱！最后，祝愿天下所有摸鱼人，都能愉快的渡过每一天");
    }

    private static long getDay(Date time, Date dirTime)
    {
        Long oneTime = 1000 * 24 * 60 * 60L;
        long l = dirTime.getTime() + oneTime;
        return (l - time.getTime()) / 1000 / 24 / 60 / 60;
    }

}
